
/**
 *
 */
package controleurs;

import java.awt.CardLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JPanel;

import modele.ModeleP;

/**
 * @author Dreimus
 *
 */
public class DescriptifBD implements ActionListener{
	public static ActionListener quitter(){
		return new ActionListener(){
			public void actionPerformed(ActionEvent arg0) {
				System.exit(0);
			}        
		};
	}
	public static ActionListener changeViews(final JPanel vue, final String nom, final CardLayout c){

		return new ActionListener(){
			public void actionPerformed(ActionEvent event){
				c.show(vue, nom);
			}
		};
	}
	private ModeleP myMod;
	public DescriptifBD(ModeleP mod){
		this.myMod=mod;
	}
	public void actionPerformed(ActionEvent arg0) {
		if(arg0.getActionCommand().equals("delete")){
			myMod.supprimer();
		}
		else if(arg0.getActionCommand().equals("modify")){
			myMod.mDebut();
		}
	}
}
